<template>
  <div>
    <a class="slide_out_area_close follow-body material-ocm-open" href="#">
      <div class="Circle" :style="{'transform':close?'scale(1)':''}">
        <span class="close-wrap" v-show="close">
          <span class="close-line close-line2"></span>
          <span class="close-line close-line1"></span>
        </span>
      </div>
    </a>
  </div>
</template>

<script>
export default {
  props: {
    close: {
      type: Boolean,
      default: true
    }
  }
};
</script>

<style lang="scss">
.slide_out_area_close {
  position: absolute;
  right: 50px;
  top: 50px;
  z-index: 8;
  display: block;

  .Circle {
    background-color: #1a99d6;
    transform: scale(0);
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border-radius: 50%;
    content: "";
    transition: all 0.45s cubic-bezier(0.15, 0.2, 0.1, 1);
  }
}

.close-wrap {
  -webkit-font-smoothing: subpixel-antialiased;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translateX(-50%) translateY(-50%) translateZ(0);
  transform: translateX(-50%) translateY(-50%) translateZ(0);
  -webkit-transition: margin 0.2s ease, opacity 0.3s ease,
    -webkit-transform 0.2s ease 1s;
  transition: margin 0.2s ease, opacity 0.3s ease,
    -webkit-transform 0.2s ease 1s;
  transition: margin 0.2s ease, transform 0.2s ease 1s, opacity 0.3s ease;
  transition: margin 0.2s ease, transform 0.2s ease 1s, opacity 0.3s ease,
    -webkit-transform 0.2s ease 1s;
  width: 20px;
  height: 20px;
  display: block;
  overflow: hidden;
}
.close-line {
  height: 100%;
  width: 2px;
  background: #fff;
  backface-visibility: hidden;
  position: absolute;
  border-radius: 5px;
  left: 9px;
  animation-fill-mode: forwards;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

@keyframes crossRight {
  100% {
    transform: translateY(0px) translateX(0px) rotate(45deg);
  }
  //  animation-delay: 0.15s;
}
@keyframes crossleft {
  100% {
    transform: translateY(0px) translateX(0px) rotate(-45deg);
  }
  //  animation-delay: 0.15s;
}
.close-line1 {
  transform: translateY(-30px) translateX(30px) rotate(45deg);
  animation: crossRight;
  animation-iteration-count: 1;
  animation-delay: 0.15s;
  animation-duration: 0.15s;
  animation-fill-mode: forwards;
}
.close-line2 {
  transform: translateY(-30px) translateX(-30px) rotate(-45deg);
  animation: crossleft;
  animation-iteration-count: 1;
  animation-delay: 0.29s;
  animation-duration: 0.15s;
  animation-fill-mode: forwards;
}
</style>